package net.oschina.archx.dao;

import net.oschina.archx.entiry.TestModel;
import net.oschina.archx.spring.sequoiadb.support.SequoiaDaoSupport;
import org.springframework.stereotype.Repository;

import java.io.Serializable;

/**
 * TestDao
 *
 * @author Archx
 * @date 2015/6/30 0030
 */
@Repository
public class TestDao extends SequoiaDaoSupport {

    public void insert(TestModel tm){
        getSession().execute("insert into clouddb.sys_fileInfo(id, path) values(#{id},#{path})", tm);
        getSession().execute("insert into clouddb.sys_fileInfo(id, path) values(?,?)", 1L, "/upload/img.png");
        getSession().execute("insert into clouddb.sys_fileInfo(id, path) values(?,?)", 1L, "/upload/img.png");
    }

    public void delete(Serializable id) {
        String sql = "delete from clouddb.sys_fileInfo where id = #{id}";
        getSession().execute(sql, id);
    }
}
